package com.wxlsoft.config.model;

import java.util.Objects;

import cn.hutool.core.io.resource.FileResource;
import lombok.Getter;

@Getter
public class ConfigFileResource {

	/**
	 * 交易码
	 */
	private String trancode;
	
	/**
	 * version
	 */
	private String version;
	
	/**
	 * 服务定义
	 */
	private FileResource service;
	
	/**
	 * 服务定义
	 */
	private FileResource clientIn;
	
	/**
	 * 服务定义
	 */
	private FileResource clientOut;
	
	/**
	 * 服务定义
	 */
	private FileResource prodIn;
	
	/**
	 * 服务定义
	 */
	private FileResource prodOut;

	public ConfigFileResource(String trancode, String version) {
		this.trancode = trancode;
		this.version = version;
	}

	public void setService(FileResource service) {
		this.service = service;
	}

	public void setClientIn(FileResource clientIn) {
		this.clientIn = clientIn;
	}

	public void setClientOut(FileResource clientOut) {
		this.clientOut = clientOut;
	}

	public void setProdIn(FileResource prodIn) {
		this.prodIn = prodIn;
	}

	public void setProdOut(FileResource prodOut) {
		this.prodOut = prodOut;
	}

	public boolean conform() {
		return Objects.nonNull(service) 
				&& Objects.nonNull(clientIn) 
				&& Objects.nonNull(clientOut) 
				&& Objects.nonNull(prodIn) 
				&& Objects.nonNull(prodOut);
	}

}
